/*
 * @Description:
 * @version:
 * @Author: 尹鹏孝
 * @Date: 2023-08-06 11:53:35
 * @LastEditors: 尹鹏孝
 * @LastEditTime: 2023-08-07 11:21:58
 */
import { Entity, Column, PrimaryGeneratedColumn,DeleteDateColumn, OneToOne, JoinColumn } from 'typeorm';
import { User } from './user.entity';
import { ApiProperty } from '@nestjs/swagger';
//这一步是将数据放在指定数据表里面Entity("数据表名称")
@Entity('user_detail')
export class UserDetail {
  // @ApiProperty({ description: '当前id', default: null })
  @ApiProperty({
    description: 'id', default: null, type: 'number',
    example: 1, required: false,
    // enum: [0, 1],
  })
  @PrimaryGeneratedColumn()
  id: number;
  //用户关联id:number
  @ApiProperty({ description: 'user_id', default: null })
  @Column()
  user_id: number;
  //用户昵称:string
  @ApiProperty({ description: '用户昵称', default: null })
  @Column()
  nick_name: string;
  //住址:string
  @ApiProperty({ description: '住户地址', default: null })
  @Column()
  address: string;
  //用户名:string
   @ApiProperty({ description: '用户名', default: null })
  @Column()
  username: string;
  //年龄
   @ApiProperty({ description: '年龄', default: null })
  @Column()
  age: number;
   //性别：number
  @ApiProperty({ description: '性别', default: null })
  @Column()
  gender: number;
  //电话:string

  @ApiProperty({ description: '电话', default: null })
  @Column()
  phone: string;

 @OneToOne(type => User, user => user.userDetail)
  user: User;
  @ApiProperty({ description: '余额', default: null })
  @Column()
  balance:number
}